package service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import vo.DepartmentVO;
import vo.MemberFloorVO;
import vo.MemberVO;
import vo.TodayYearVO;
import dao.MemberDao;

@Service
public class MemberServiceImpl implements MemberService{
	@Resource(name="memberDaoImpl")
	private MemberDao memberDao;

	@Override
	public MemberVO loginService(MemberVO mvo){
		return memberDao.loginRow(mvo);
	}
	
	@Override
	public int registerService(MemberVO mvo){
		return memberDao.registerRow(mvo);
	}

	@Override
	public List<MemberFloorVO> monthstep(String mid) {
		List<MemberFloorVO> mfList=memberDao.getmonthstep(mid);
		int size = mfList.size();
		if (size < 12) {
			for (int i = 0; i < 12 - size; i++) {
				MemberFloorVO mfvo = new MemberFloorVO();
				mfvo.setMid(mid);
				mfvo.setStairyear("");
				mfvo.setStairdate("");
				mfvo.setStairs(0);
				mfList.add(mfvo);
			}
		}
		return mfList;
	}

	@Override
	public List<MemberVO> userInfo() {
		return memberDao.getuserInfo();
	}

	@Override
	public List<DepartmentVO> deptInfo() {
		return memberDao.getdeptInfo();
	}

	@Override
	public TodayYearVO todaystep(String mid) {
		return memberDao.gettodaystep(mid);
	}

	@Override
	public TodayYearVO yearstep(String mvo) {
		return memberDao.getyearstep(mvo);
	}

	@Override
	public int getTemperature(String mid) {
		return memberDao.getTemperature(mid);
	}

	@Override
	public MemberVO getProfile(MemberVO mvo) {
		return memberDao.getProfile(mvo);
	}

	@Override
	public int updateProfile(MemberVO mvo) {
		return memberDao.updateProfile(mvo);
	}

}
